package it.unibo.deis.lia.mmhc.fnm;

//oggetto inviato per l'attivazione del servizio client e server ai due estremi e path nei nodi intemedi
import it.unibo.deis.lia.mmhc.spm.Service;

import java.util.Vector;

public class ServiceAttivation extends MessageObject {

	private String richiedente;
	private String fornitore;
	private Service servizio;
	private Vector<String> goPath;
	private int numberNextGoHop;
	private Vector<String> backPath;
	private int numberNextBackHop;
	private boolean serviceOpened;

	public ServiceAttivation(int hopToLive, Object ogg, String richiedente,
			String fornitore, Service servizio, Vector<String> goPath,
			Vector<String> backPath) {
		super(hopToLive, ogg);
		this.richiedente = richiedente;
		this.fornitore = fornitore;
		this.servizio = servizio;
		this.goPath = goPath;
		this.numberNextGoHop = 0;
		this.backPath = backPath;
		this.numberNextBackHop = 0;
		this.serviceOpened = false;
	}

	public boolean isServiceOpened() {
		return serviceOpened;
	}

	public void setServiceOpened(boolean serviceOpened) {
		this.serviceOpened = serviceOpened;
	}

	public String getRichiedente() {
		return richiedente;
	}

	public String getFornitore() {
		return fornitore;
	}

	public Service getServizio() {
		return servizio;
	}

	public Vector<String> getGoPath() {
		return goPath;
	}

	public int getNumberNextGoHop() {
		return numberNextGoHop;
	}

	public Vector<String> getBackPath() {
		return backPath;
	}

	public int getNumberNextBackHop() {
		return numberNextBackHop;
	}

	public String getNextGoHop() {
		String hop = goPath.elementAt(numberNextGoHop);
		numberNextGoHop++;
		return hop;
	}

	public String getNextBackHop() {
		String hop = backPath.elementAt(numberNextBackHop);
		numberNextBackHop++;
		return hop;
	}

}
